package xiao.ke.serviceinvoker1.controller;/**
 * @author XuXiaoK
 * @create 2020-01-22 21:19
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import xiao.ke.serviceinvoker1.entity.Book;
import xiao.ke.serviceinvoker1.service.BookService;

/**
 * @Author XiaoKe
 * @Date 2020/1/22 21:19
 * @Description TODO
 */
@RestController
@Configuration
public class SaleController {

    @Autowired
    private BookService bookService;

    @GetMapping("/salebook/{bookId}")
    public String saleBook(@PathVariable Integer bookId) {
        Book book = bookService.getBook(bookId);
        System.out.println(book.getId() + book.getName() + book.getAuthor());

        return "success";
    }
}
